package edu.sdjzu.ex03consumer8002.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import edu.sdjzu.common.entity.University;

import java.util.List;

@RestController
public class UniversityController {
    @Autowired
    private RestTemplate restTemplate;
    public static String url = "http://provider/";
    @GetMapping("/university")
    public List<University> selectList() {
        return restTemplate.getForObject(url + "university", List.class);
    }
}
